
// PhotoEditDlg.h : header file
//

#pragma once


#include "afxcmn.h"
#include "afxwin.h"
#include "PhotoProject.h"
#include "DlgHomeTab.h"

// CPhotoEditDlg dialog
class CPhotoEditDlg : public CDialogEx
{
// Construction
public:
	CPhotoEditDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_PHOTOEDIT_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	int THUMBNAIL_WIDTH;
	int THUMBNAIL_HEIGHT;
	HICON m_hIcon;
	CBrush  m_brush;
	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
	int m_TreeWidth;
	int m_TabHeight;
	CPhotoProject m_photo;
	void UpdateInfo();
	vector<TCHAR*> GetAllSubFolders(TCHAR* lpszFileName);
	void GetAllFile(TCHAR* lpszFileName,TCHAR* extend,vector<TCHAR*> &listImg);
	HTREEITEM InsertDirectory(TCHAR* lpszFileName,HTREEITEM parent,int img);
	TCHAR* GetName(TCHAR* lpszFileName);
	void  DrawThumbnails(vector<TCHAR*> files );
	void RefreshDirectory();
	CImageList imgl;
	CImageList m_ImageListThumb;
	bool m_isFitScreen;
public:
	CTreeCtrl m_ctrTree;
	CStatic m_ctrPictureBox;
	CTabCtrl m_ctrTab;
	CButton m_ctrSave;
	CButton m_ctrSaveAs;
	CStatic m_ctrFileInfo;
	CString m_fileName;
	CDlgHomeTab m_dlgTabHome;

	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);

	afx_msg void OnFileOpen();
	
	afx_msg void OnStnClickedStaticInfo();

	afx_msg void OnBnClickedButtonSave();
	afx_msg void OnBnClickedButtonSaveas();
	afx_msg void OnFileSave();
	afx_msg void OnFileSaveas();
	afx_msg void OnEditUndo();
	afx_msg void OnTvnItemexpandingTreeDirectory(NMHDR *pNMHDR, LRESULT *pResult);
	
	CListCtrl m_ctrList;
	
	afx_msg void OnNMClickListFile(NMHDR *pNMHDR, LRESULT *pResult);

	afx_msg void OnClose();
	CButton m_ctrCheckFit;
	afx_msg void OnBnClickedCheckFitscreen();
	
	afx_msg void OnTvnItemChangedTreeDirectory(NMHDR *pNMHDR, LRESULT *pResult);
};
